<admintpl file="header" />
<style>
    .ys1{
        width: 120px;height: 15px;border: 0 solid white;text-align: center
    }
    a{cursor: pointer;}
    .fl{float:left;}
    .c-pages{padding:20px 0; text-align: center;}
    .c-pages.tl{text-align: left;}
    .c-pages span{display: inline-block; margin-right: 5px; font-size:12px; height:28px; line-height: 28px;}
    .c-pages span.col{color: #fe344e; font-weight: 600;}
    .c-pages span a{display: inline-block; margin:0 3px; height:28px; line-height: 28px; text-align: center; padding:0 12px; border:1px solid #ccc; text-decoration: none; border-radius: 2px;}
    .c-pages span a:link,.c-pages span a:active,.c-pages span a:visited{color: #333;}
    .c-pages span a:hover{ color: #157efb; border: 1px solid #157efb;}
    .c-pages span a.active{color: #fff; background: #157efb; border:1px solid #157efb;}
    .c-pages  .current{ color: #fff; background: #157efb; border: 1px solid #157efb; display: inline-block; margin: 0 3px; height: 28px;
        line-height: 28px;
        text-align: center;
        padding: 0 12px;
        text-decoration: none;
        border-radius: 2px;
    }
    div{
        margin-bottom: 20px;
    }
    .txt{
        margin-right: 100px;
    }

    .addWei{background: none; border:1px solid #ff8540; color: #ff8540; padding:4px 6px; font-size: 14px;float:right;margin-left:80px;margin-top:4px;}

</style>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">

    <div id="mydiv" style="width: 650px">
   
        <form action="{:U('Order/bankcard_upd')}" enctype="multipart/form-data" method="post" id="form">
          <input type="hidden" name="dengji" value="{$dengji}">
          <div style="margin-top: 80px">
            <span >
                 <span style="margin-left: 20px">等&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级:</span>
				<input type="text" value="{$da.dengji}" readonly="readonly" style="width: 60px;height: 14px"><br/>
                <span style="margin-left: 20px">开户银行:</span>
				<input type="text" name="yinhang"  value="{$da.yinhang}"><br>
				<span style="margin-left: 20px">账户姓名:</span>
				<input type="text" name="name" class="name" style="margin-left: 5px;width: 100px;height: 16px" value="{$da.name}"><br/>
				<span style="margin-left: 20px">卡&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</span>
				<input type="text" name="yinhangka" class="kahao1" style="margin-left: 5px;width: 170px;margin-right: 50px;height: 16px" value="{$da.number}"><br/>
				<span style="margin-left: 20px">确认卡号:</span>
				<input type="text" name="yinhangka" class="kahao2" style="margin-left: 5px;width: 170px;margin-right: 50px;height: 16px"placeholder="请再次输入卡号"><br/>
                <span style="margin-left: 20px">开户支行:</span>
				<input type="text" name="zhihang" class="zhihang" value="{$da.zhihang}" style="margin-left: 5px;width: 170px;margin-right: 50px;height: 16px"><br/>
                 <input class="btn btn-danger" type="button" value="确认修改" onclick="sav()" style="margin-left: 220px;margin-top: 120px">
            </span>
          </div>
        </form>

</div>
</div>
</body>
</html>


<script src="public/js/laydate/laydate.js"></script>

<script>

    function sav(){
        var kahao1 = $(".kahao1").val();
        var kahao2 = $(".kahao2").val();
        var name1 = $(".name").val();
        var name = name1.replace(/\s+/g,"");
        if(name == ''){
            alert("账户姓名不能为空");
            return false;
        }
        // 账户姓名必须是汉字
        if(!/^[\u4e00-\u9fa5]+$/gi.test(name)){
            alert("账户姓名必须为汉字");
            return false
        }
        if(name.length>5 || name.length<2){
            alert("账户姓名在两个汉字-五个汉字之间");
            return false;
        }
        if(kahao1 == ''){
            alert("银行卡号不能为空");
            return false;
        }
        if(kahao1.length < 16 || kahao1.length > 19) {
            alert("银行卡号长度必须在16到19之间");
            return false;
        }
        var num = /^\d*$/; //全数字
        if(!num.exec(kahao1)) {
            alert("银行卡号必须全为数字");
            return false;
        }
        //开头6位
        var strBin = "10,18,30,35,37,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,62,65,68,69,84,87,88,94,95,98,99";
        if(strBin.indexOf(kahao1.substring(0, 2)) == -1) {
            alert("银行卡号开头6位不符合规范");
            return false;
        }
        if(kahao2 == ''){
            alert("确认卡号不能为空");
            return false;
        }
        if(kahao2 != kahao1){
            alert("两次输入的卡号不正确");
            return false;
        }
        $("#form").submit();
    }
</script>